/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Metier;

import java.sql.Date;
import java.text.SimpleDateFormat;

/**
 *
 * @author kazanova
 */
public class Divorce {
    ///////////////
    // Attributs //
    ///////////////

    private int id;
    private Vip vip1;
    private Vip vip2;
    private Date date;

    ///////////////////
    // Constructeurs //
    ///////////////////
    public Divorce(int id, Vip vip1, Vip vip2, Date date) {
        this.id = id;
        this.vip1 = vip1;
        this.vip2 = vip2;
        this.date = date;
    }
    public Divorce(Vip vip1, Vip vip2, Date date) {
        this.id = -1;
        this.vip1 = vip1;
        this.vip2 = vip2;
        this.date = date;
    }

    ////////////////////////
    // Methodes publiques //
    ////////////////////////
    // Getters
    public Date getDate() {
        return date;
    }

    public int getId() {
        return id;
    }

    public Vip getVip1() {
        return vip1;
    }

    public Vip getVip2() {
        return vip2;
    }

    // Setters
    public void setDate(Date date) {
        this.date = date;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setVip1(Vip vip1) {
        this.vip1 = vip1;
    }

    public void setVip2(Vip vip2) {
        this.vip2 = vip2;
    }

    public String toString() {
        SimpleDateFormat dateFormatSql = new SimpleDateFormat("dd-MM-yy");
        return "Divorce de "+vip1.toString()+" "+vip2.toString()+" ("+dateFormatSql.format(date)+")";
    }
}
